package com.xbongbong.saas.service;

import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.pro.fundaccount.pojo.dto.FundAccountAddDTO;
import com.xbongbong.pro.fundaccount.pojo.dto.FundAccountBatchUpdateDTO;
import com.xbongbong.pro.fundaccount.pojo.dto.FundAccountDeleteDTO;
import com.xbongbong.pro.fundaccount.pojo.dto.FundAccountGetDTO;
import com.xbongbong.pro.fundaccount.pojo.dto.FundAccountStatusDTO;
import com.xbongbong.pro.fundaccount.pojo.vo.FundAccountAddVO;
import com.xbongbong.pro.fundaccount.pojo.vo.FundAccountGetVO;
import com.xbongbong.pro.fundaccount.pojo.vo.FundAccountStatusVO;

import java.util.Map;

/**
 * @author zhouwq
 * @date 2019/10/23 10:32
 */

public interface FundAccountService {

    /**
     * 新增资金账户
     * @param fundAccountAddDTO 入参
     * @return 回参
     * @throws XbbException error
     */
    FundAccountAddVO add(FundAccountAddDTO fundAccountAddDTO) throws XbbException;

    /**
     * 更新资金账户
     * @param fundAccountAddDTO 入参
     * @return 回参
     * @throws XbbException error
     */
    FundAccountAddVO update(FundAccountAddDTO fundAccountAddDTO) throws XbbException;

    /**
     * 删除资金账户
     * @param fundAccountDeleteDTO 入参
     * @return 回参
     * @throws XbbException error
     */
    FundAccountAddVO delete(FundAccountDeleteDTO fundAccountDeleteDTO) throws XbbException;

    /**
     * 改变资金账户
     * @return 开启或关闭信息
     * @throws XbbException error
     */
    FundAccountStatusVO changeEnableStatus(FundAccountStatusDTO fundAccountStatusDTO) throws XbbException;

    /**
     * 根据状态查询账户列表，status为空时查询全部
     * @param corpid 公司ID
     * @param status 账户状态
     * @return 账户列表
     * @throws XbbException error
     */
    FundAccountGetVO getFundAccountsByStatus(String corpid, Integer status) throws XbbException;

    /**
     * 获取账户列表
     * @param fundAccountGetDTO 入参
     * @return 账户列表
     * @throws XbbException error
     */
    FundAccountGetVO getFundAccounts(FundAccountGetDTO fundAccountGetDTO) throws XbbException;

    /**
     * 更新账户余额
     * @param accountId 账户ID
     * @param amount 修改金额
     * @param corpid 公司ID
     * @throws XbbException error
     */
    void saveByPaymentSheetOrPaySheet(Long accountId, Double amount, String corpid) throws XbbException;

    /**
     * 批量更新账户余额
     * @param fundAccountToAmountMap 账户ID以及金额对应关系
     * @throws XbbException error
     */
    void saveBatchByPaymentSheetOrPaySheet(Map<Long, Double> fundAccountToAmountMap) throws XbbException;

    /**
     * 更新资金账户
     * @param fundAccountBatchUpdateDTO 入参
     * @return 回参
     * @throws XbbException error
     */
    FundAccountAddVO updateDefaultAccount(FundAccountBatchUpdateDTO fundAccountBatchUpdateDTO) throws XbbException;

}
